3.4.59 \(\int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx\) [359]

3.4.59.1 Optimal result
3.4.59.2 Mathematica [A] (verified)
3.4.59.3 Rubi [A] (verified)
3.4.59.4 Maple [A] (verified)
3.4.59.5 Fricas [A] (verification not implemented)
3.4.59.6 Sympy [A] (verification not implemented)
3.4.59.7 Maxima [A] (verification not implemented)
3.4.59.8 Giac [A] (verification not implemented)
3.4.59.9 Mupad [B] (verification not implemented)

3.4.59.1 Optimal result

Integrand size = 33, antiderivative size = 109 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {(A-B+C) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(2 A+3 B-8 C) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}+\frac {(2 A+3 B+7 C) \sin (c+d x)}{15 d \left (a^3+a^3 \cos (c+d x)\right )} \]

output
1/5*(A-B+C)*sin(d*x+c)/d/(a+a*cos(d*x+c))^3+1/15*(2*A+3*B-8*C)*sin(d*x+c)/ 
a/d/(a+a*cos(d*x+c))^2+1/15*(2*A+3*B+7*C)*sin(d*x+c)/d/(a^3+a^3*cos(d*x+c) 
)
 
3.4.59.2 Mathematica [A] (verified)

Time = 1.02 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.50 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (5 (4 A+3 B+8 C) \sin \left (\frac {d x}{2}\right )-15 (B+2 C) \sin \left (c+\frac {d x}{2}\right )+10 A \sin \left (c+\frac {3 d x}{2}\right )+15 B \sin \left (c+\frac {3 d x}{2}\right )+20 C \sin \left (c+\frac {3 d x}{2}\right )-15 C \sin \left (2 c+\frac {3 d x}{2}\right )+2 A \sin \left (2 c+\frac {5 d x}{2}\right )+3 B \sin \left (2 c+\frac {5 d x}{2}\right )+7 C \sin \left (2 c+\frac {5 d x}{2}\right )\right )}{30 a^3 d (1+\cos (c+d x))^3} \]

input
Integrate[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)/(a + a*Cos[c + d*x])^3,x 
]
 
output
(Cos[(c + d*x)/2]*Sec[c/2]*(5*(4*A + 3*B + 8*C)*Sin[(d*x)/2] - 15*(B + 2*C 
)*Sin[c + (d*x)/2] + 10*A*Sin[c + (3*d*x)/2] + 15*B*Sin[c + (3*d*x)/2] + 2 
0*C*Sin[c + (3*d*x)/2] - 15*C*Sin[2*c + (3*d*x)/2] + 2*A*Sin[2*c + (5*d*x) 
/2] + 3*B*Sin[2*c + (5*d*x)/2] + 7*C*Sin[2*c + (5*d*x)/2]))/(30*a^3*d*(1 + 
 Cos[c + d*x])^3)
 
3.4.59.3 Rubi [A] (verified)

Time = 0.49 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.02, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {3042, 3498, 25, 3042, 3229, 3042, 3127}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a \cos (c+d x)+a)^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^3}dx\)

\(\Big \downarrow \) 3498

\(\displaystyle \frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}-\frac {\int -\frac {a (2 A+3 B-3 C)+5 a C \cos (c+d x)}{(\cos (c+d x) a+a)^2}dx}{5 a^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \frac {a (2 A+3 B-3 C)+5 a C \cos (c+d x)}{(\cos (c+d x) a+a)^2}dx}{5 a^2}+\frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {a (2 A+3 B-3 C)+5 a C \sin \left (c+d x+\frac {\pi }{2}\right )}{\left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2}dx}{5 a^2}+\frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3229

\(\displaystyle \frac {\frac {1}{3} (2 A+3 B+7 C) \int \frac {1}{\cos (c+d x) a+a}dx+\frac {a (2 A+3 B-8 C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}+\frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {1}{3} (2 A+3 B+7 C) \int \frac {1}{\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}dx+\frac {a (2 A+3 B-8 C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}+\frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3127

\(\displaystyle \frac {\frac {(2 A+3 B+7 C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)}+\frac {a (2 A+3 B-8 C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}+\frac {(A-B+C) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

input
Int[(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)/(a + a*Cos[c + d*x])^3,x]
 
output
((A - B + C)*Sin[c + d*x])/(5*d*(a + a*Cos[c + d*x])^3) + ((a*(2*A + 3*B - 
 8*C)*Sin[c + d*x])/(3*d*(a + a*Cos[c + d*x])^2) + ((2*A + 3*B + 7*C)*Sin[ 
c + d*x])/(3*d*(a + a*Cos[c + d*x])))/(5*a^2)
 

3.4.59.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3127
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + 
 d*x]/(d*(b + a*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b 
^2, 0]
 

rule 3229
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(b*c - a*d)*Cos[e + f*x]*((a + b*Sin[e + f* 
x])^m/(a*f*(2*m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(a*b*(2*m + 1))   I 
nt[(a + b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && 
NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]
 

rule 3498
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + 
(f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b - a* 
B + b*C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(a*f*(2*m + 1))), x] + Simp[1 
/(a^2*(2*m + 1))   Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[a*A*(m + 1) + m*(b 
*B - a*C) + b*C*(2*m + 1)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, 
 B, C}, x] && LtQ[m, -1] && EqQ[a^2 - b^2, 0]
 
3.4.59.4 Maple [A] (verified)

Time = 1.90 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.59

method result size
parallelrisch \(\frac {\left (\left (A -B +C \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {10 \left (A -C \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+5 A +5 B +5 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{20 a^{3} d}\) \(64\)
derivativedivides \(\frac {\frac {A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}-\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}+\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{5}+\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{4 d \,a^{3}}\) \(113\)
default \(\frac {\frac {A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}-\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{5}+\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{5}+\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{4 d \,a^{3}}\) \(113\)
risch \(\frac {2 i \left (15 C \,{\mathrm e}^{4 i \left (d x +c \right )}+15 B \,{\mathrm e}^{3 i \left (d x +c \right )}+30 C \,{\mathrm e}^{3 i \left (d x +c \right )}+20 A \,{\mathrm e}^{2 i \left (d x +c \right )}+15 B \,{\mathrm e}^{2 i \left (d x +c \right )}+40 C \,{\mathrm e}^{2 i \left (d x +c \right )}+10 A \,{\mathrm e}^{i \left (d x +c \right )}+15 B \,{\mathrm e}^{i \left (d x +c \right )}+20 C \,{\mathrm e}^{i \left (d x +c \right )}+2 A +3 B +7 C \right )}{15 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5}}\) \(141\)
norman \(\frac {\frac {\left (A -B +C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 a d}+\frac {\left (A +B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {\left (4 A +3 B +2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {\left (8 A -3 B -2 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{30 a d}+\frac {\left (19 A +6 B -C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{30 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} a^{2}}\) \(154\)

input
int((A+B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+cos(d*x+c)*a)^3,x,method=_RETURNVER 
BOSE)
 
output
1/20*((A-B+C)*tan(1/2*d*x+1/2*c)^4+10/3*(A-C)*tan(1/2*d*x+1/2*c)^2+5*A+5*B 
+5*C)*tan(1/2*d*x+1/2*c)/a^3/d
 
3.4.59.5 Fricas [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.94 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {{\left ({\left (2 \, A + 3 \, B + 7 \, C\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, A + 3 \, B + 2 \, C\right )} \cos \left (d x + c\right ) + 7 \, A + 3 \, B + 2 \, C\right )} \sin \left (d x + c\right )}{15 \, {\left (a^{3} d \cos \left (d x + c\right )^{3} + 3 \, a^{3} d \cos \left (d x + c\right )^{2} + 3 \, a^{3} d \cos \left (d x + c\right ) + a^{3} d\right )}} \]

input
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c))^3,x, algorithm= 
"fricas")
 
output
1/15*((2*A + 3*B + 7*C)*cos(d*x + c)^2 + 3*(2*A + 3*B + 2*C)*cos(d*x + c) 
+ 7*A + 3*B + 2*C)*sin(d*x + c)/(a^3*d*cos(d*x + c)^3 + 3*a^3*d*cos(d*x + 
c)^2 + 3*a^3*d*cos(d*x + c) + a^3*d)
 
3.4.59.6 Sympy [A] (verification not implemented)

Time = 1.31 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.65 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\begin {cases} \frac {A \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{20 a^{3} d} + \frac {A \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{3} d} + \frac {A \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{4 a^{3} d} - \frac {B \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{20 a^{3} d} + \frac {B \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{4 a^{3} d} + \frac {C \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{20 a^{3} d} - \frac {C \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{3} d} + \frac {C \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{4 a^{3} d} & \text {for}\: d \neq 0 \\\frac {x \left (A + B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right )}{\left (a \cos {\left (c \right )} + a\right )^{3}} & \text {otherwise} \end {cases} \]

input
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)/(a+a*cos(d*x+c))**3,x)
 
output
Piecewise((A*tan(c/2 + d*x/2)**5/(20*a**3*d) + A*tan(c/2 + d*x/2)**3/(6*a* 
*3*d) + A*tan(c/2 + d*x/2)/(4*a**3*d) - B*tan(c/2 + d*x/2)**5/(20*a**3*d) 
+ B*tan(c/2 + d*x/2)/(4*a**3*d) + C*tan(c/2 + d*x/2)**5/(20*a**3*d) - C*ta 
n(c/2 + d*x/2)**3/(6*a**3*d) + C*tan(c/2 + d*x/2)/(4*a**3*d), Ne(d, 0)), ( 
x*(A + B*cos(c) + C*cos(c)**2)/(a*cos(c) + a)**3, True))
 
3.4.59.7 Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.64 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\frac {A {\left (\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{3}} + \frac {C {\left (\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{3}} + \frac {3 \, B {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{3}}}{60 \, d} \]

input
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c))^3,x, algorithm= 
"maxima")
 
output
1/60*(A*(15*sin(d*x + c)/(cos(d*x + c) + 1) + 10*sin(d*x + c)^3/(cos(d*x + 
 c) + 1)^3 + 3*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/a^3 + C*(15*sin(d*x + 
c)/(cos(d*x + c) + 1) - 10*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 3*sin(d*x 
 + c)^5/(cos(d*x + c) + 1)^5)/a^3 + 3*B*(5*sin(d*x + c)/(cos(d*x + c) + 1) 
 - sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/a^3)/d
 
3.4.59.8 Giac [A] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.06 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {3 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 10 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{60 \, a^{3} d} \]

input
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c))^3,x, algorithm= 
"giac")
 
output
1/60*(3*A*tan(1/2*d*x + 1/2*c)^5 - 3*B*tan(1/2*d*x + 1/2*c)^5 + 3*C*tan(1/ 
2*d*x + 1/2*c)^5 + 10*A*tan(1/2*d*x + 1/2*c)^3 - 10*C*tan(1/2*d*x + 1/2*c) 
^3 + 15*A*tan(1/2*d*x + 1/2*c) + 15*B*tan(1/2*d*x + 1/2*c) + 15*C*tan(1/2* 
d*x + 1/2*c))/(a^3*d)
 
3.4.59.9 Mupad [B] (verification not implemented)

Time = 1.37 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.67 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (A-B+C\right )}{20\,a^3\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,A-2\,C\right )}{12\,a^3\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+B+C\right )}{4\,a^3\,d} \]

input
int((A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3,x)
 
output
(tan(c/2 + (d*x)/2)^5*(A - B + C))/(20*a^3*d) + (tan(c/2 + (d*x)/2)^3*(2*A 
 - 2*C))/(12*a^3*d) + (tan(c/2 + (d*x)/2)*(A + B + C))/(4*a^3*d)